package com.sumainfor.wx.tenant.service.impl;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.tenant.entity.TctenTenantLike;
import com.sumainfor.wx.tenant.dao.TctenTenantLikeMapper;
import com.sumainfor.wx.tenant.service.TctenTenantLikeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 喜爱 服务实现类
 * </p>
 *
 * @author PuaChen
 * @since 2019-01-28
 */
@Service
public class TctenTenantLikeServiceImpl extends ServiceImpl<TctenTenantLikeMapper, TctenTenantLike> implements TctenTenantLikeService {
    @Autowired
    private TctenTenantLikeMapper tctenTenantLikeMapper;
    /**
     * 根据房源详表编号和租客的编号查询房源是否是喜爱房源
     */
    public JsonResult selectLikeHousing(Map<String, Object> params) {
        JsonResult result=new JsonResult();
        if (params.get("HouInfoId")==null || params.get("TenId")==null){
            return result.putFailed("参数不正确");
        }
        Map<String,Object> map=tctenTenantLikeMapper.selectLikeHousing(params);
        if (map!= null) {
            result.put(map);
        }else{
            result.putFailed("服务器繁忙");
        }

        return result;
    }
}
